package com.hdq.mapper;

import entity.Rule;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleRuleMapper {

    /**
     * 根据角色id查询角色对应的权限菜单
     * @param roleId
     * @return
     */
    @Select("select r.* from rule r left join role_rule r_r on r.id=r_r.rule_id where r_r.role_id = #{roleId} and r.menu = #{menu}")
    List<Rule> getRuleInfoByRoleId(@Param("roleId") Long roleId, @Param("menu") Integer menu);



}
